library(ggplot2) # beautiful graphs

library(ggthemes) # nice themes for ggplot2

library(ggbeeswarm) # helpful 'beeswarm' geometry

library(cowplot) # arrrange graphs

library(pander) # nice tables

How to Choose a Chart

Choosing the right chart to represent your data can be a daunting process. I believe that a starting point for this thinking is some basic statistical thinking about the type of variables that you have. At the broadest level, variables may be conceptualized as categorical variables, or continuous variables.

Once we have discerned the type of variable that have, there are two followup questions we may ask before deciding upon a chart strategy:

A Few Notes

A Note About Graph Labels

Graphs should have clear titles and labels.

A Simulated Data File of Continuous and Categorical Data

A few randomly selected observations…

  x y z u v w s q
19 95.88 74.81 67.81 Group A Group A Group A Group 3 125.9
855 144.3 85.35 170.3 Group B Group B Group A Group 2 164.3
499 235.9 227.6 91.63 Group A Group A Group B Group 2 255.9
740 150.8 66.02 113.8 Group B Group A Group A Group 2 170.8
130 102.5 91.71 91.5 Group B Group B Group A Group 2 122.5
764 212.6 113.2 68.67 Group B Group A Group B Group 2 232.6
442 108.5 110.3 80.88 Group A Group A Group A Group 3 138.5
217 168.6 158.4 70.27 Group B Group B Group B Group 3 198.6
382 199.5 258 143 Group A Group B Group B Group 3 229.5
767 225 197.5 100.7 Group B Group A Group B Group 2 245

One Thing At A Time           Two Things At A Time

Continuous           Continuous By Categorical

One Thing At A Time           Two Things At A Time

Categorical           Categorical By Categorical

Continuous by Continuous

Graphics made with the ggplot2 graphing library created by Hadley Wickham.

Available online at https://agrogan1.github.io/

How to Choose a Chart by Andrew Grogan-Kaylor is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. You are welcome to download and use this handout in your own classes, or work, as long as the handout remains properly attributed.

Last updated: July 09 2019 at 11:17